function tests = test_global_ex14_2_9
tests = functiontests(localfunctions);

function test1(testCase)
% Model generated from ex14_2_9.gms
% Created 02-Aug-2007 10:42:42 using YALMIP R20070725

% Setup a clean YALMIP environment 
yalmip('clear') 

% Define all variables 
x1 = sdpvar(1);
x2 = sdpvar(1);
x3 = sdpvar(1);
x5 = sdpvar(1);

% Define objective function 
objective = -(0-x5-0);

% Define constraints 
F = ([]);
F=[F,8.86*log(2.1055*x1+4.0456*x2)-7.888*log(1.972*x1+3.236*x2)-(2.1105532*x2-0.922208999999999*x1)/(2.1055*x1+4.0456*x2)-(0.848*log(1.52337552625369*x1+3.236*x2)+1.124*log(1.17581829697036*x1+0.197740576646344*x2))-((1.29182244626313*x1+1.29182244626313*x2)/(1.52337552625369*x1+3.236*x2)+3.29049113670798*x2/(1.52337552625369*x1+3.236*x2)+0.347329619985842*x2/(1.52337552625369*x1+3.236*x2)+1.32161976579469*x1/(1.17581829697036*x1+0.197740576646344*x2))-3803.98/(231.47+x3)-x5<=-13.1111702786953];
F=[F,15.18*log(2.1055*x1+4.0456*x2)-12.944*log(1.972*x1+3.236*x2)-(4.05530944*x2-1.7719728*x1)/(2.1055*x1+4.0456*x2)-(0.848*log(1.52337552625369*x1+3.236*x2)+2.16*log(1.52337552625369*x1+3.236*x2)+0.228*log(1.52337552625369*x1+3.236*x2))-((2.744128*x1+2.744128*x2)/(1.52337552625369*x1+3.236*x2)+6.98976*x2/(1.52337552625369*x1+3.236*x2)+0.737808*x2/(1.52337552625369*x1+3.236*x2)+0.222260408150491*x1/(1.17581829697036*x1+0.197740576646344*x2))-2735.58621973158/(226.276+x3)-x5<=-11.2003192377536];
F=[F,7.888*log(1.972*x1+3.236*x2)-8.86*log(2.1055*x1+4.0456*x2)+(2.1105532*x2-0.922208999999999*x1)/(2.1055*x1+4.0456*x2)+0.848*log(1.52337552625369*x1+3.236*x2)+1.124*log(1.17581829697036*x1+0.197740576646344*x2)+(1.29182244626313*x1+1.29182244626313*x2)/(1.52337552625369*x1+3.236*x2)+3.29049113670798*x2/(1.52337552625369*x1+3.236*x2)+0.347329619985842*x2/(1.52337552625369*x1+3.236*x2)+1.32161976579469*x1/(1.17581829697036*x1+0.197740576646344*x2)+3803.98/(231.47+x3)-x5<=13.1111702786953];
F=[F,12.944*log(1.972*x1+3.236*x2)-15.18*log(2.1055*x1+4.0456*x2)+(4.05530944*x2-1.7719728*x1)/(2.1055*x1+4.0456*x2)+0.848*log(1.52337552625369*x1+3.236*x2)+2.16*log(1.52337552625369*x1+3.236*x2)+0.228*log(1.52337552625369*x1+3.236*x2)+(2.744128*x1+2.744128*x2)/(1.52337552625369*x1+3.236*x2)+6.98976*x2/(1.52337552625369*x1+3.236*x2)+0.737808*x2/(1.52337552625369*x1+3.236*x2)+0.222260408150491*x1/(1.17581829697036*x1+0.197740576646344*x2)+2735.58621973158/(226.276+x3)-x5<=11.2003192377536];
F=[F,x1+x2==1];
F=[F,1e-006<=x1<=1];
F=[F,1e-006<=x2<=1];
F=[F,40<=x3<=90];
F=[F,0<=x5];

% Solve problem
sol = optimize(F,objective,sdpsettings('bmibnb.uppersolver','fmincon','solver','bmibnb'));
testCase.assertTrue(sol.problem==0)
testCase.assertTrue(abs(value(objective)-0) <= 1e-2) 